<template>
	<u-modal 
		:show="show" 
		:title="currentMessage.title" 
		:content='currentMessage.content'
		show-cancel-button
		cancel-text="忽略"
		confirm-text="查看详情"
		@confirm="toDetail"
		@cancel="ignoreMsg"
	></u-modal>
</template>

<script>
import { mapGetters, ignorePush } from "vuex"
export default {
	data(){
		return {
			show: false
		}
	},
	watch: {
		pushList(nv) {
			this.show = nv.length > 0
		}
	},
	computed: {
		...mapGetters(["pushList"]),
		currentMessage(){
			return this.pushList[0] || {}
		}
	},
	methods: {
		ignoreMsg(){
			this.show = false
		},
		toDetail(){
			this.show = false
		}
	}
}
</script>

<style scoped lang="scss">
</style>